{% extends 'home/index.html'%}
{% block title %}
<title>个人信息管理</title>
{% endblock %}

{% block css %}
<link href="/static/home/css/personal.css" rel="stylesheet" type="text/css">
<link href="/static/home/css/infstyle.css" rel="stylesheet" type="text/css">

{% endblock %}


{% block con %}
<div class="nav-table">
   <div class="long-title"><span class="all-goods">全部分类</span></div>
   <div class="nav-cont">
        <ul>
            <li class="index"><a href="{% url 'home_index' %}">首页</a></li>
            <li class="qc"><a href="#">闪购</a></li>
            <li class="qc"><a href="#">限时抢</a></li>
            <li class="qc"><a href="#">团购</a></li>
            <li class="qc last"><a href="#">大包装</a></li>
        </ul>
        <div class="nav-extra">
            <i class="am-icon-user-secret am-icon-md nav-user"></i><b></b>我的福利
            <i class="am-icon-angle-right" style="padding-left: 10px;"></i>
        </div>
    </div>
</div>
<b class="line"></b>

<div class="center">
    <div class="col-main">
        <div class="main-wrap">

            <div class="user-info">
                <!--标题 -->
                <div class="am-cf am-padding">
                    <div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">个人资料</strong> / <small>Personal&nbsp;information</small></div>
                </div>
                <hr/>

                <!--头像 -->
                <form action="{% url 'home_personalinformation'%}?uid={{user.id}}" method="post" enctype="multipart/form-data" class="am-form am-form-horizontal">
                    {% csrf_token %}
                    <div class="user-infoPic">

                        <div class="filePic">
                            <input name="pic_url" type="file" class="inputPic" allowexts="gif,jpeg,jpg,png,bmp" accept="image/*">
                            <img class="am-circle am-img-thumbnail" src="{{ user.pic_url }}" alt="用户头像" />
                        </div>

                        <p class="am-form-help">头像</p>

                        <div class="info-m">
                            <div><b>用户名：<i>{{ user.username }}</i></b></div>
                            <div class="u-level">
                               
                            </div>
                            <div class="u-safety">
                                <a href="safety.html">
                                 账户安全
                                <span class="u-profile"><i class="bc_ee0000" style="width: 60px;" width="0">60分</i></span>
                                </a>
                            </div>
                        </div>
                    </div>
                    <!--个人信息 -->
                    <div class="info-main">
                        <div class="am-form-group">
                            <label for="user-username" class="am-form-label">用户名</label>
                            <div class="am-form-content">
                                <input name="username" id="user-username"  type="text" value="{{ user.username }}">

                            </div>
                        </div>
                      
                        <div class="am-form-group">
                           <label for="user-password" class="am-form-label">密码</label>
                           <div class="am-form-content">
                                <input name="password" id="user-password" placeholder="请输入您要修改的密码" type="text" >

                            </div>
                        </div>

                        <div class="am-form-group">
                            <label class="am-form-label">性别</label>
                            <div class="am-form-content sex">
                                <label class="am-radio-inline">
                                    <input type="radio" name="sex" value="1" {% if user.sex == '1' %} checked {% endif %}  data-am-ucheck> 男
                                       
                                </label>
                                <label class="am-radio-inline">
                                    <input type="radio" name="sex" value="0" {% if user.sex == '0' %} checked {% endif %} data-am-ucheck> 女
                                  
                                </label>
                            
                            </div>
                        </div>
                        <div class="am-form-group">
                            <label for="user-age" class="am-form-label">年龄</label>
                            <div class="am-form-content">
                                <input name="age" id="user-age" placeholder="age" type="text" value="{{ user.age }}">

                            </div>
                        </div>
                        <div class="am-form-group">
                            <label for="user-phone" class="am-form-label">电话</label>
                            <div class="am-form-content">
                                <input name="phone" id="user-phone" placeholder="telephonenumber" type="tel" value="{{ user.phone }}">

                            </div>
                        </div>

                        <div class="am-form-group">
                            <label for="user-email" class="am-form-label">电子邮件</label>
                            <div class="am-form-content">
                                <input  name="email"  id="user-email" placeholder="Email" type="email" value="{{ user.email }}">

                            </div>
                        </div>
                     <!--    <div class="am-form-group address">
                            <label for="user-address" class="am-form-label">收货地址</label>
                            <div class="am-form-content address">
                                <a href="address.html">
                                    <p class="new-mu_l2cw">
                                        <span class="province">湖北</span>省
                                        <span class="city">武汉</span>市
                                        <span class="dist">洪山</span>区
                                        <span class="street">雄楚大道666号(中南财经政法大学)</span>
                                        <span class="am-icon-angle-right"></span>
                                    </p>
                                </a>

                            </div>
                        </div>
                        <div class="am-form-group safety">
                            <label for="user-safety" class="am-form-label">账号安全</label>
                            <div class="am-form-content safety">
                                <a href="safety.html">

                                    <span class="am-icon-angle-right"></span>

                                </a>

                            </div>
                        </div> -->
                        <div class="info-btn">
                            <div class="am-btn am-btn-danger edit">保存修改</div>
                        </div>
                </form>
                </div>

            </div>

        </div>
   
    </div>

    <aside class="menu">
        <ul>
            <li class="person">
                <a href="index.html">个人中心</a>
            </li>
            <li class="person">
                <a href="#">个人资料</a>
                <ul>
                    <li class="active"> <a href="{% url 'home_personalinformation'%}">个人信息</a></li>
                    <li> <a href="{% url 'home_addressmanage'%}">收货地址</a></li>
                </ul>
            </li>
            <li class="person">
                <a href="#">我的交易</a>
                <ul>
                    <li><a href="{% url 'home_myorderinfo'%}">订单管理</a></li>
                </ul>
            </li>
           

        </ul>

    </aside>
</div>

<script type="text/javascript">
    $('.edit').click(function(){
        // 获取表单，进行提交
        $(this).parents('form').submit()
    })
</script>


{% endblock %}
